import sys
import time
import pari
import __main__
import __builtin__
from pari import *

class prompt:
    def __str__(self):
        return time.strftime('\033[33m(%H:%M) gp > \033[0m')
        
sys.ps1=prompt()

pari.__current_o = 1

def pari_hook(o):
    if o != None :
        name = '_'+str(pari.__current_o)
        pari.__current_o += 1
        setattr(__main__, name, o)
        setattr(__builtin__, '_', o)
        print '\033[35m'+name+' =\033[0m', o 

sys.displayhook = pari_hook

def var(s):
    setattr(__main__, s, pari.var(s))

# some settings
var('x')
real_prec(28)
ser_prec(16)
div_behavior(1)
p0=cast(0)
p1=cast(1)
p=cast
